# from itn.chinese.inverse_normalizer import InverseNormalizer
# from tn.chinese.normalizer import Normalizer as ZhNormalizer
# from tn.english.normalizer import Normalizer as EnNormalizer

# NOTE(xcsong): 和默认参数不一致时，必须重新构图，要重新构图请务必指定 `overwrite_cache=True`
#               When the parameters differ from the defaults, it is mandatory to re-compose. To re-compose, please ensure you specify `overwrite_cache=True`.

# zh_tn_text = "你好 WeTextProcessing 1.0，船新版本儿，船新体验儿，简直666，9和10"
# zh_itn_text = "你好 WeTextProcessing 一点零，船新版本儿，船新体验儿，简直六六六，九和六"
# en_tn_text = "Hello WeTextProcessing 1.0, life is short, just use wetext, 666, 9 and 10"
# zh_tn_model = ZhNormalizer(remove_erhua=True, overwrite_cache=True)
# zh_itn_model = InverseNormalizer(enable_0_to_9=False, overwrite_cache=True)
# en_tn_model = EnNormalizer(overwrite_cache=True)
# print("中文 TN (去除儿化音，重新在线构图):\n\t{} => {}".format(zh_tn_text, zh_tn_model.normalize(zh_tn_text)))
# print("中文ITN (小于10的单独数字不转换，重新在线构图):\n\t{} => {}".format(zh_itn_text, zh_itn_model.normalize(zh_itn_text)))
# print("英文 TN (暂时还没有可控的选项，后面会加...):\n\t{} => {}\n".format(en_tn_text, en_tn_model.normalize(en_tn_text)))
#
# zh_tn_model = ZhNormalizer(overwrite_cache=False)
# zh_itn_model = InverseNormalizer(overwrite_cache=False)
# en_tn_model = EnNormalizer(overwrite_cache=False)
# print("中文 TN (复用之前编译好的图):\n\t{} => {}".format(zh_tn_text, zh_tn_model.normalize(zh_tn_text)))
# print("中文ITN (复用之前编译好的图):\n\t{} => {}".format(zh_itn_text, zh_itn_model.normalize(zh_itn_text)))
# print("英文 TN (复用之前编译好的图):\n\t{} => {}\n".format(en_tn_text, en_tn_model.normalize(en_tn_text)))
#
# zh_tn_model = ZhNormalizer(remove_erhua=False, overwrite_cache=True)
# zh_itn_model = InverseNormalizer(enable_0_to_9=True, overwrite_cache=True)
# print("中文 TN (不去除儿化音，重新在线构图):\n\t{} => {}".format(zh_tn_text, zh_tn_model.normalize(zh_tn_text)))
# print("中文ITN (小于10的单独数字也进行转换，重新在线构图):\n\t{} => {}\n".format(zh_itn_text, zh_itn_model.normalize(zh_itn_text)))
from gxl_ai_utils.utils import utils_file
# data_list_path = "/apdcephfs_qy3/share_976139/users/kaixunhuang/buf/test_dir/test_20250429_fleurs_en.jsonl"
new_data_list_path = "/apdcephfs_qy3/share_976139/users/kaixunhuang/buf/test_dir/test_20250429_fleurs_en_tn.jsonl"
dict_list = utils_file.load_dict_list_from_jsonl(new_data_list_path)
new_dict_list = []
for dict_i in utils_file.tqdm(dict_list, desc="tn_itn_do"):
    txt = dict_i["text"]
    new_txt = utils_file.remove_punctuation_keep_quote(txt)
    dict_i["text"] = new_txt
    new_dict_list.append(dict_i)
utils_file.write_dict_list_to_jsonl(new_dict_list, new_data_list_path)

# if __name__ == '__main__':
#     txt = "The aspect ratio of this format (dividing by twelve to obtain the simplest whole-number ratio) is therefore said to be three to two."
#     print(utils_file.remove_punctuation_keep_quote(txt))
